//
//  LLNotice1TableViewCell.m
//  LoveLove
//
//  Created by wkf on 2019/4/2.
//  Copyright © 2019 wkf. All rights reserved.
//

#import "LLNotice1TableViewCell.h"

@implementation LLNotice1TableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initView];
    }
    return self;
}

- (void)initView{
    self.headImage = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, 36, 36)];
    self.headImage.image = [UIImage imageNamed:@"椭圆 1596"];
    self.headImage.layer.masksToBounds = YES;
    self.headImage.contentMode = UIViewContentModeScaleAspectFill;
    self.headImage.layer.cornerRadius = 18;
    [self.contentView addSubview:self.headImage];
    
    self.titleLabel = [LLInitBaseViewTool labelWithText:@"谁谁谁谁谁谁谁谁..." textColor:LLColorRGB(49) font:18 textAlignment:NSTextAlignmentLeft];
    [self.contentView addSubview:self.titleLabel];
    
    self.timeLabel = [LLInitBaseViewTool labelWithText:@"2018年11月11日 10：21" textColor:LLColorRGB(127) font:13 textAlignment:NSTextAlignmentLeft];
    [self.contentView addSubview:self.timeLabel];
    
    self.praiseButton = [LLInitBaseViewTool buttonWithTitle:@"赞了你发的帖子" image:@"hea 拷贝 2" titleColor:LLColorRGB(49) font:18];
    self.praiseButton.frame = CGRectMake(66, 34, LLScreenWidth-81, 18);
    self.praiseButton.userInteractionEnabled = NO;
    self.praiseButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    self.praiseButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
    [self.contentView addSubview:self.praiseButton];
    
    self.booknameLabel = [LLInitBaseViewTool labelWithText:@"《钢琴怎么谈？》" textColor:LLColorRGB(49) font:13 textAlignment:NSTextAlignmentLeft];
    self.booknameLabel.frame = CGRectMake(66, 64, LLScreenWidth-81, 13);
    [self.contentView addSubview:self.booknameLabel];
    
    self.lineview = [[UIView alloc] initWithFrame:CGRectMake(66, 92, LLScreenWidth-81, 1)];
    self.lineview.backgroundColor = LLColorRGB(243);
    [self.contentView addSubview:self.lineview];
    
    CGFloat wid = [CommonTools sizeOfText:self.timeLabel.text fontSize:13 width:MAXFLOAT height:13].width;
    self.timeLabel.frame = CGRectMake(LLScreenWidth-5-wid, 10, wid, 13);
    self.titleLabel.frame = CGRectMake(66, 10, LLScreenWidth-76-wid, 18);
}
//        id = 109;
//"img_url" =                 (
//);
//"is_family" = 2;
//"love_id" = 110;
//"new_title" = "\U641e\U7b11\U751f\U6d3b\U89c6\U9891";
//time = "2019-06-23 11:11:56";
//type = 4;
//"users_avatar" = "http://haoaihao.oss-cn-beijing.aliyuncs.com/2a42956955784c984d3f974106b6acd7.jpg";
//"users_id" = 13;
//"users_name" = "2019\U52a0\U6cb9\U54271";
-(void)configNoticeCell:(NSDictionary *)dic{
    self.titleLabel.text = dic[@"users_name"];
    self.booknameLabel.text =dic[@"new_title"];
     [self.headImage sd_setImageWithURL:LLImageWithUrl(dic[@"users_avatar"]) placeholderImage:[UIImage imageNamed:@"placeholder"] options:SDWebImageRefreshCached];
    self.timeLabel.text = dic[@"time"];
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
